package online.afeibaili.storebackendframework.model.json

class ProductJsonMapper(val productId: Long, var count: Int) {
    constructor() : this(0, 0)

    override fun toString(): String {
        return "ProductJsonMapper(productId=$productId, count=$count)"
    }

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is ProductJsonMapper) return false

        if (productId != other.productId) return false
        if (count != other.count) return false

        return true
    }

    override fun hashCode(): Int {
        var result = productId.hashCode()
        result = 31 * result + count
        return result
    }

    companion object : JsonMapperAbstract<ProductJsonMapper>(ProductJsonMapper::class.java)
}